import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:smart_devices/model/department.dart';
import 'package:smart_devices/params/device.dart';

class DeviceScreenLogic extends GetxController {
  Rx<DeviceParams> params = Rx(DeviceParams(type: DeviceTypeEnum.all));

  Rx<TextEditingController> titleController =
      Rx(TextEditingController(text: DeviceTypeEnum.all.label));

  Rx<TextEditingController> deptController = Rx(TextEditingController());

  Rx<TextEditingController> statusController =
      Rx(TextEditingController(text: DeviceStatusEnum.all.label));

  RxList<DepartmentModel> depts = RxList([
    DepartmentModel(deptId: 1, name: '技术部'),
    DepartmentModel(deptId: 2, name: '生产部'),
    DepartmentModel(deptId: 3, name: '品质部')
  ]);

  @override
  void onClose() {
    super.onClose();
    titleController.value.dispose();
    deptController.value.dispose();
    statusController.value.dispose();
  }
}
